﻿@inject IStringLocalizer<CircleNormal> Localizer

<Circle Value="@_circleValue" />
<div class="mt-3">
    <div class="btn-group">
        <button class="btn btn-primary" @onclick="e => Add(10)">
            <i class="fa-solid fa-plus"></i>
            <span>@Localizer["IncreaseSpan"] 10</span>
        </button>
        <button class="btn btn-info" @onclick="e => Add(-10)">
            <i class="fa-solid fa-minus"></i>
            <span>@Localizer["DecreaseSpan"] 10</span>
        </button>
    </div>
</div>

@code {
    private int _circleValue = 0;

    private void Add(int interval)
    {
        _circleValue += interval;
        _circleValue = Math.Min(100, Math.Max(0, _circleValue));
    }
}
